package com.qingke.OMS.Command.Imp;

import java.util.List;

import com.qingke.OMS.Command.Command;
import com.qingke.OMS.Dao.GoodsDao;

import com.qingke.OMS.Pojo.Goods;

import com.qingke.OMS.Unit.Console;

public class checkGoodsByCodeCommand implements Command{

	@Override
	public void execute() {
		 
	GoodsDao gdao = new GoodsDao();
	int code = Console.askUserInputInt("Please enter what's goods' code?");
	
		
		List<Goods> gs = gdao.getGoodsByCode(code);
		if(gs==null){
	    	Console.println("Invalid quetion Code!");
	        return ;
	    }
	 for (Goods good2 : gs) {
		System.out.println(good2);
	}
		
	}

}
